Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Conlisk 432 posts 1008 karma points
    Mar 28, 2009 @ 15:40
    David Conlisk
    0

    System.Xml.XmlException: Invalid character in the given encoding [solved]

    Hello,

    I just upgraded a site that's in development from v4.0.0 to the latest v4.0.1. Everything seemed fine. Now, however, I have a problem with all xslt on the site. If I try to create a new xslt file through Umbraco, or try to save an existing one, I get an exception:

    [quote]
    Error occured

    System.Xml.XmlException: Invalid character in the given encoding. Line 4, position 63.
    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
    at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
    at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
    at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
    at System.Xml.XmlTextReaderImpl.ReadData()
    at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type, Int32& outStartPos, Int32& outEndPos)
    at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type)
    at System.Xml.XmlTextReaderImpl.ParseComment()
    at System.Xml.XmlTextReaderImpl.ParseElementContent()
    at System.Xml.XmlTextReaderImpl.Read()
    at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
    at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
    at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
    at System.Xml.XmlDocument.Load(XmlReader reader)
    at System.Xml.XmlDocument.Load(String filename)
    at umbraco.macro.GetXsltExtensions()
    at umbraco.macro.AddMacroXsltExtensions()
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

    [/quote]

    If I try to view the macro on a page on the site, I get "Error parsing XSLT file" errors. This applies to all xslt on the whole site. The error is exactly the same, regardless of which xslt file we're looking at - always Line 4, position 63.

    Any ideas?

    This is a clean v4 site that I've just updated to the latest v4.0.1 following these instructions:

    http://forum.umbraco.org/yafpostst8947Upgrade-Umbraco-400-to-401.aspx

    Thanks,

    David

  • David Conlisk 432 posts 1008 karma points
    Mar 28, 2009 @ 15:46
    David Conlisk
    0

    Okay, I solved it. Because the error was always the same I thought to have a look at the config files. The xsltExtensions.config file had a weird character in it -

    [code]


    [/code]

    I removed the comment from the file, saved it, et viola - problem solved.

    EDIT: When you download the new v4.0.1 file, it uses unusual comments characters, so where you see the little � icon, above, in the original file it uses different double-quotes than usual - they are open/close ones:
    [code]


    [/code]

    I did a lot of copying files about the place, and used winmerge to copy changes within files, so at some point the weird quotes became invalid characters...


Please Sign in or register to post replies

Write your reply to:

Draft